<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">


    <ui:composition template="../../master.xhtml">
        <ui:define name="menu">
            <ui:include src="../menu.xhtml" /> 
        </ui:define>

        <ui:define name="TituloModulo">

            Gestão de Utilizadores
        </ui:define>

        <ui:define name="TituloConteudoPrincipal">
            Visualizar Grupo
        </ui:define>


        <ui:define name="ConteudoPrincipal">

            <p:messages globalOnly="true"/>
            <h:form>
                <h:panelGrid columns="2">

                    <h:outputText value="#{bundle01.designacao}"/>
                    <h:outputText value="#{tipoUsuarioController.selected.designacao}" title="#{bundle01.designacao}"/>
                    <h:outputText value="#{bundle01.descricao}"/>
                    <h:outputText value="#{tipoUsuarioController.selected.descricao}" title="#{bundle01.descricao}"/>
                    
                    <p:orderList value="#{tipoUsuarioController.selected.permissaoUsuarioCollection}" rendered="#{tipoUsuarioController.selected.permissaoUsuarioCollection.size()!=0}"
                                 var="permissao" controlsLocation="none"  
                                 itemLabel="#{permissao.accao}" itemValue="#{permissao}"/>
                    <h:outputText value="Sem Pemissões associadas" rendered="#{tipoUsuarioController.selected.permissaoUsuarioCollection.size()==0}"/>
                    
                </h:panelGrid>

                <p:commandButton ajax="false" action="#{tipoUsuarioController.destroyAndView}" value="#{bundle01.eliminar}"/>

                <p:commandButton ajax="false" action="Edit" value="#{bundle01.editar}" disabled="true" title="Desabilitado pelo Admintrador por questões de segurança"/>

                <p:commandButton ajax="false" action="#{tipoUsuarioController.prepareList}" value="#{bundle01.listar}"/>

            </h:form>
        </ui:define>
    </ui:composition>

</html>
